#pragma once
#include<vector>
#include"Graphic.h"
#define CD_DEFAULT_WIDTH	150
#define CD_DEFAULT_HEIGHT	200
class CardDraw
{
	friend class CardDrawContainer;
public:
	CardDraw(std::wstring card_name_id);
	~CardDraw();
public:
	std::wstring GetCardNameId();
public:
	void SetSize(LOGIC_AXIS width, LOGIC_AXIS height);
	void OnDraw(Graphic & gfx, bool is_select = false);
private:
	std::wstring card_name_id;
	Card * card;
	int id;
	int fm_id;
	LOGIC_AXIS width, height;
};

class CardDrawContainer : public IDraw
{
public:
	CardDrawContainer();
public:
	void Push(CardDraw draw);
	void SetSize(LOGIC_AXIS width, LOGIC_AXIS height);
	void SetPosition(LOGIC_AXIS x, LOGIC_AXIS y);
	void SetSpace(LOGIC_AXIS space_x, LOGIC_AXIS space_y);
	void CountPerPage(int column, int row);
	void SetPage(int page);
	void ForceRow(int count);
	void ForceColumn(int count);
public:
	std::wstring MouseTo(int x, int y);
	bool IsSomeMouseTo(int & a, int & b, bool is_change);
	bool ForceMouseTo();
public:
	int last_select_x;
	int last_select_y;
	int force_x, force_y;
public:
	virtual void OnDraw(Graphic & gfx) override;
private:
	std::vector<CardDraw> draws;
private:
	LOGIC_AXIS width, height;
	LOGIC_AXIS x, y;
	LOGIC_AXIS space_x, space_y;
	int column_per_page;
	int row_per_page;
	int page;
};
